import useGetUserInfo from '@/hooks/useGetUserInfo';
import { ROUTE_PATH } from '@/router';
import React, { FC, useEffect, useState } from 'react';
import { Link } from 'react-router-dom';
//
import { Space, Typography } from 'antd';
import { FormOutlined } from '@ant-design/icons';
//

const { Title } = Typography;

const Logo:FC=()=>{

    const { username }=useGetUserInfo()
    const [pathname,setPathname]=useState(ROUTE_PATH.HOME)

    useEffect(()=>{
        setPathname(ROUTE_PATH.QUESTION_EDIT)
    },[username])

    return (
        <div>
            <Link to={pathname}>
            <Space>
                <Title>
                    <FormOutlined/>
                </Title>
                <Title>小慕问卷</Title>
            </Space>
            </Link>
        </div>
    )
}

export default Logo;